package com.wjk.kylin.mall.order.beanmapper;

import com.wjk.kylin.mall.order.bo.OrderBO;
import com.wjk.kylin.mall.order.dto.OrderAddInDTO;
import com.wjk.kylin.mall.order.dto.OrderUpdateInDTO;
import com.wjk.kylin.mall.order.entity.OrderEntity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author: wangjinkui
 * @Date: 2021/5/30
 * @Description : 订单
 */
@Mapper
public interface OrderEntityMapper {
    OrderEntityMapper INSTANCE = Mappers.getMapper(OrderEntityMapper.class);

    /**
     * entity to bo
     *
     * @param entity
     * @return
     */
    OrderBO entity2BO(OrderEntity entity);

    /**
     * entity list to bo
     *
     * @param list
     * @return
     */
    List<OrderBO> entity2BOs(List<OrderEntity> list);


    /**
     * dto to entity
     *
     * @param dto
     * @return
     */
    OrderEntity addDto2Entity(OrderAddInDTO dto);

    /**
     * dto to entity
     *
     * @param dto
     * @return
     */
    OrderEntity updateDto2Entity(OrderUpdateInDTO dto);
}
